package com.uzai.console.mapper;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.uzai.console.dto.fd.fddeviceplangroup.FdDevicePlanGroupQuery;
import com.uzai.console.entity.FdDevicePlanGroup;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.ArrayList;

@Repository
public interface FdDevicePlanGroupMapper {
    int deleteById(@Param("id") Long id, @Param("merId") Long merId);

    int deleteByByFdDevicePlanId(@Param("fdDevicePlanId") Long fdDevicePlanId, @Param("merId") Long merId);

    int insert(FdDevicePlanGroup record);

    int insertSelective(FdDevicePlanGroup record);

    FdDevicePlanGroup selectById(@Param("id") Long id, @Param("merId") Long merId);

    int updateByIdSelective(FdDevicePlanGroup record);

    int updateById(FdDevicePlanGroup record);

    /**根据配置方案id查询所有的设备方案群信息
     *
     * @param fdDevicePlanId
     * @return
     */
    ArrayList<FdDevicePlanGroup> findByListByFdDevicePlanId(@Param("fdDevicePlanId") Long fdDevicePlanId, @Param("merId") Long merId);

    /**
     * 分页查询
     * @param page
     * @param query
     * @return
     */
    ArrayList<FdDevicePlanGroup> findByList(Page<FdDevicePlanGroup> page, @Param("query") FdDevicePlanGroupQuery query);

    /**
     * 查询所有
     * @param query
     * @return
     */
    ArrayList<FdDevicePlanGroup> findByList(@Param("query") FdDevicePlanGroupQuery query);
}